<?php /* @var $this ProductController */ ?>
<?php if (Yii::app()->user->hasFlash('success')): ?>
    <div class="alert alert-success">  
        <a class="close" data-dismiss="alert">×</a>  
        <?php echo Yii::app()->user->getFlash('success') ?>
    </div>  
<?php endif ?>
<?php if (Yii::app()->user->hasFlash('error')): ?>
    <div class="alert alert-error">  
        <a class="close" data-dismiss="alert">×</a>  
        <?php echo Yii::app()->user->getFlash('error') ?>
    </div>  
<?php endif ?>
<?php $form = $this->beginWidget('CActiveForm'); ?>
<?php /* @var $form CActiveForm */?>
<div class="row">
    <div class="span12">
        <fieldset>  
            <legend>Sản phẩm</legend>  
            <div class='clearfix'>
                <label for="name">Số lượng</label>
                <div class='input'>
                    <?php echo $form->textField($model, 'amount', array('size' => 80, 'maxlength' => 128)); ?>
                    <?php echo $form->error($model, 'amount'); ?>
                </div>
            </div>
            <div class='clearfix'>
                <label for="address">Giá trị</label>
                <div class='input'>
                   <?php echo $form->textField($model, 'value', array('size' => 80, 'maxlength' => 128)); ?>
                    <?php echo $form->error($model, 'value'); ?>
                </div>
            </div>
            <div class='clearfix'>
                <label for="address">Từ ngày</label>
                <div class='input'>
                    <?php echo $form->textField($model, 'from_date', array('size' => 80, 'maxlength' => 128,'class'=>'date')); ?>
                    <?php echo $form->error($model, 'from_date'); ?>
                </div>
            </div>
            <div class='clearfix'>
                <label for="address">Đến ngày</label>
                <div class='input'>
                   <?php echo $form->textField($model, 'to_date', array('size' => 80, 'maxlength' => 128,'class'=>'date')); ?>
                    <?php echo $form->error($model, 'to_date'); ?>
                </div>
            </div>
            <div class='clearfix'>
                <div class='input'>
                    <?php echo CHtml::submitButton('Tạo coupon', array('class' => 'btn btn-primary')); ?>
                    <?php echo CHtml::button('Quay về trang phiếu giảm giá', array('class' => 'btn', 'onclick' => 'javascript:location.href = \''.$this->createUrl('index').'\'')) ?>
                </div>
            </div>

        </fieldset> 
    </div>
</div>
<?php $this->endWidget(); ?>
<script>
    $(function() {
        $(".date").datepicker({
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true
        });
    });
</script>